package com.ruoyi.guarantee.service.impl;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.guarantee.domain.BLetter;
import com.ruoyi.guarantee.mapper.BLetterMapper;
import com.ruoyi.guarantee.service.IBLetterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 出函机构Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-18
 */
@Service
public class BLetterServiceImpl implements IBLetterService {

    @Autowired
    private BLetterMapper bLetterMapper;

    /**
     * 查询出函机构
     *
     * @param id 出函机构主键
     * @return 出函机构
     */
    @Override
    public BLetter selectBLetterById(Long id)
    {
        return bLetterMapper.selectBLetterById(id);
    }

    /**
     * 查询出函机构列表
     *
     * @param bLetter 出函机构
     * @return 出函机构
     */
    @Override
    public List<BLetter> selectBLetterList(BLetter bLetter)
    {
        return bLetterMapper.selectBLetterList(bLetter);
    }

    /**
     * 新增出函机构
     *
     * @param bLetter 出函机构
     * @return 结果
     */
    @Override
    public int insertBLetter(BLetter bLetter)
    {
        bLetter.setCreateTime(DateUtils.getNowDate());
        return bLetterMapper.insertBLetter(bLetter);
    }

    /**
     * 修改出函机构
     *
     * @param bLetter 出函机构
     * @return 结果
     */
    @Override
    public int updateBLetter(BLetter bLetter)
    {
        bLetter.setUpdateTime(DateUtils.getNowDate());
        return bLetterMapper.updateBLetter(bLetter);
    }

    /**
     * 批量删除出函机构
     *
     * @param ids 需要删除的出函机构主键
     * @return 结果
     */
    @Override
    public int deleteBLetterByIds(Long[] ids)
    {
        return bLetterMapper.deleteBLetterByIds(ids);
    }

    /**
     * 删除出函机构信息
     *
     * @param id 出函机构主键
     * @return 结果
     */
    @Override
    public int deleteBLetterById(Long id)
    {
        return bLetterMapper.deleteBLetterById(id);
    }

    @Override
    public List<BLetter> selectDuiije() {
        return bLetterMapper.selectDuiije();
    }

    @Override
    public List<BLetter> selectBLetterByName(BLetter letter) {
        return bLetterMapper.selectBLetterByName(letter);
    }
}
